﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Runtime.Remoting.Messaging;
using System.Text;
using System.Threading.Tasks;

namespace HengWang.OA.Model
{
    public class DBHelper
    {
        /// <summary>
        /// 上下文唯一
        /// </summary>
        /// <returns></returns>
        public static HengWangOADBEntities Create()
        {
            HengWangOADBEntities db = CallContext.GetData("ef") as HengWangOADBEntities;
            if (db==null)
            {
                db = new HengWangOADBEntities();
                CallContext.SetData("ef",db);
            }
            return db;
        }
    }
}
